home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Linux
/
Kubuntu 8.10
/
kubuntu-8.10-desktop-i386.iso
/
casper
/
filesystem.squashfs
/
etc
/
cron.daily
/
mlocate
< prev
next >
Wrap
Text File
|
2008-06-26
|
646b
|
38 lines
#! /bin/bash
set -e
[ -x /usr/bin/updatedb.mlocate ] || exit 0
if which on_ac_power >/dev/null 2>&1; then
AC_POWER=0
on_ac_power >/dev/null 2>&1 || AC_POWER=$?
if [ "$AC_POWER" -eq 1 ]; then
echo >&2 "On battery power, not running today."
exit 1
fi
fi
##
LOCKFILE="/var/lib/mlocate/daily.lock"
trap "rm -f $LOCKFILE" EXIT
if [ -e "$LOCKFILE" ]; then
echo >&2 "Warning: $LOCKFILE present, not running today."
exit 1
else
touch "$LOCKFILE"
fi
##
# See ionice(1)
if [ -x /usr/bin/ionice ] &&
/usr/bin/ionice -c3 true 2>/dev/null; then
IONICE="/usr/bin/ionice -c3"
fi
$IONICE /usr/bin/updatedb.mlocate